package com.csproj.system.service.dto;


import com.csproj.system.domain.AuthorityInfo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;


import java.io.Serializable;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

/**
 * A DTO for the RoleInfo entity.
 */
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class RoleInfoDTO implements Serializable {

    private String id;

    private String name;

    private String organizationId;

    private Integer sort;

    private String remark;

    public Boolean getUsedFlag() {
        return usedFlag;
    }

    public void setUsedFlag(Boolean usedFlag) {
        this.usedFlag = usedFlag;
    }

    private Boolean usedFlag;

    private Set<AuthorityInfo> authorityInfos = new HashSet<>();

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public String getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(String organizationId) {
        this.organizationId = organizationId;
    }
    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Set<AuthorityInfo> getAuthorityInfos() {
        return authorityInfos;
    }

    public RoleInfoDTO setAuthorityInfos(Set<AuthorityInfo> authorityInfos) {
        this.authorityInfos = authorityInfos;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        RoleInfoDTO roleInfoDTO = (RoleInfoDTO) o;

        if ( ! Objects.equals(id, roleInfoDTO.id)) { return false; }

        return true;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "RoleInfoDTO{" +
            "id=" + id +
            ", name='" + name + "'" +
            ", organizationId='" + organizationId + "'" +
            ", sort='" + sort + "'" +
            '}';
    }
}
